package com.electric.service.impl;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.electric.common.LoggerInterface;
import com.electric.entity.User;
import com.electric.mapper.UserMapper;
import com.electric.service.IUserService;

/**
 * <p>
 * 用户表 服务实现类
 * </p>
 *
 * @author zhangbin
 * @since 2018-08-28
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService,LoggerInterface{

	public User checkLoing(String userName, String userPwd) {
		try{
			EntityWrapper<User> wrapper = new EntityWrapper<User>();
			wrapper.eq("login_name", userName);
			wrapper.eq("login_pwd", userPwd);
			
			return selectOne(wrapper);
		} catch(Exception e){
			logger.error(e.getMessage(),e);
			return null;
		}
	}

}
